package com.wanghua.mall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wanghua.common.utils.PageUtils;
import com.wanghua.mall.product.entity.AttrGroupEntity;
import com.wanghua.mall.product.frontvo.SkuItemVo;
import com.wanghua.mall.product.frontvo.SpuItemAttrGroup;
import com.wanghua.mall.product.vo.AttrAndGroupVo;
import com.wanghua.mall.product.vo.AttrGroupResponseVo;

import java.util.List;
import java.util.Map;

/**
 * 属性分组
 *
 * @author wanghua
 * @email 2367279431@qq.com
 * @date 2021-08-23 16:10:06
 */
public interface AttrGroupService extends IService<AttrGroupEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 根据分类id查询相关属性分组
     */
    PageUtils listByCategoryId(Map<String, Object> params, Long categoryId);

    /**
     * 查询属性分组完整信息
     */
    AttrGroupResponseVo infoDetail(Long id);

    /**
     * 删除分组时，连带设置所关联的基本属性的分组id字段为0
     */
    void deleteDetail(Long[] ids);

    //获取分类下所有分组&关联属性
    List<AttrAndGroupVo> getAllAttrGroupAndAttrByCategoryId(Long categoryId);

    //获取spu下所有分组&关联属性
    List<SpuItemAttrGroup> getAllAttrGroupAndAttrBySpuId(Long spuId);
}

